home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Programare / sharp / wwwSharp_setup.exe / {app} / Examples / Data access / Data bindings (DataSet XML) / index.hta < prev   
Text File  |  2003-12-16  |  2KB  |  69 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4.     <TITLE>www-Sharp.ClrHost DataSet XML example</TITLE>
  5.     <META name="GENERATOR" content="MSHTML 6.00.2800.1264">
  6.     <META http-equiv="MSThemeCompatible" content="Yes">
  7.     <OBJECT id="dsDemo" classid="clsid:A53ECD51-C062-4B08-97F0-4944CD7D88E7">
  8.         <PARAM name="XmlSchema" value="Country.xsd">
  9.         <PARAM name="Xml" value="Country.xml">
  10.     </OBJECT>
  11. <STYLE>
  12. TH
  13. {
  14.     background-color: #99CC33;
  15. }
  16.  
  17. TD
  18. {
  19.     background-color: #00FF99;
  20. }
  21.  
  22. BUTTON
  23. {
  24.     width: 100px;
  25. }
  26. </STYLE>
  27. <SCRIPT>
  28. window.onload = Fill;
  29.  
  30. function Fill()
  31. {
  32.     var i;
  33.     var str = "<TABLE id=\"tblCountry\" dataSrc=\"#dsDemo.country\" border=\"0\" width=\"100%\" dataPageSize=\"5\">\r\n";
  34.  
  35.     var rs = dsDemo.namedRecordset("country");
  36.     if (rs == null)
  37.     {
  38.         window.alert("Recordset is not valid");
  39.         return;
  40.     }
  41.     
  42.     str += "<THEAD>\r\n<TR>\r\n";
  43.     for (i = 0; i < rs.Fields.Count; i++)
  44.         str += "<TH>" + rs.Fields.Item(i).Name + "</TH>\r\n";
  45.     str += "</TR>\r\n</THEAD>\r\n";
  46.  
  47.     str += "<TBODY>\r\n<TR>\r\n";
  48.     for (i = 0; i < rs.Fields.Count; i++)
  49.         //str += "<TD><INPUT type=\"text\" dataFld=\"" + rs.Fields.Item(i).Name + "\"></TD>\r\n";
  50.         str += "<TD><SPAN dataFld=\"" + rs.Fields.Item(i).Name + "\"></SPAN></TD>\r\n";
  51.     str += "</TR>\r\n</TBODY>\r\n";
  52.     
  53.     str += "</TABLE>";
  54.  
  55.     tblCountry.outerHTML = str;
  56. }
  57. </SCRIPT>
  58. </HEAD>
  59. <BODY>
  60.     <BUTTON id="btnFirst" onclick="tblCountry.firstPage()">< <</BUTTON>
  61.     <BUTTON id="btnPrev" onclick="tblCountry.previousPage()"><</BUTTON>
  62.     <BUTTON id="btnNext" onclick="tblCountry.nextPage()">></BUTTON>
  63.     <BUTTON id="btnLast" onclick="tblCountry.lastPage()">> ></BUTTON>
  64.     <TABLE id="tblCountry">
  65.         <TBODY></TBODY>
  66.     </TABLE>
  67. </BODY>
  68. </HTML>
  69.